package hfdp.chp06.chp0604;

/**
 * Created by cheyiwen on 16/8/30.
 */
public class CeilingFan {

    private String location;
    static final int HIGH = 3;
    static final int MEDIUM = 2;
    static final int LOW = 1;
    static final int OFF = 0;
    private int speed;

    public CeilingFan(String location) {
        this.location = location;
        speed = OFF;
    }

    public void on() {
        System.out.println(location + " ceiling fan is on hight");
    }

    public void off() {
        speed = OFF;
        System.out.println(location + " ceiling fan is off");
    }

    public void high(){
        speed = HIGH;
        System.out.println(location + " ceiling fan tunes to high");
    }

    public void medium(){
        speed = MEDIUM;
        System.out.println(location + " ceiling fan tunes to medium");
    }

    public void low(){
        speed = LOW;
        System.out.println(location + " ceiling fan tunes to low");
    }

    public int getSpeed(){
        return speed;
    }
}
